package com.example.webserver.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;


@Data
public class User {
    @NotNull
    private int id;

    @Size(min = 5,max = 16,message = "用户名应为5~16个字符")
    private String username;

    @JsonIgnore
    @Size(min = 5,max = 16,message = "密码应为5~16个字符")
    private String password;

    @NotEmpty
    @Size(min = 1,max = 10,message = "昵称应为1~10个字符")
    private String nickname;

    @Email
    private String email;

    private String user_pic;//头像地址
    private LocalDateTime create_time;
    private LocalDateTime update_time;
}
